package cn.yrec.rain.analysis.vo;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 描述: 场次降雨特征值实体类
 * @createDate: 2020/07/06 上午 10:27
 * @author: yanglichen
 */
@Data
public class RainfallResult  implements Serializable {

    private static final long serialVersionUID = -3221366583735838442L;

    /**降雨开始的日期*/
    private Date rainfallDate;
    /**降雨结束的日期*/
    private Date endRainfallDate;
    /**降雨历时*/
    private Integer rainfallTakeTime;
    /**总降雨面积(单位:平方米)*/
    private Double totalRainfallArea;
    /**总降雨量(单位:mm)*/
    private Double totalRainfallQ;
    /**前期雨量指数*/
    private Double beforeRainfallPoint;
    /**暴雨中心*/
    private MaxRainObjectVo maxRainObject;

    /**相似性(原型雨为100)*/
    private Double lookLikePoint;
    /**相似值(原型雨为0)*/
    private Double resemblance;
    /**最大点雨量的名称*/
    private String maxRainfallStnm;
    /**时段降雨笼罩面积(时间大的在前)*/
    private List<Double> dateRainfallArea;
    /**时段降雨雨量*/
    private List<Double> dateRainfallQ;
    /**时段降雨量*/
    private List<Map<String, String[]>> timeRainfallQ;
    /**降雨参数实例*/
    private RainfallParameters rainfallParameters;
    /**最大降雨天数对象*/
    private List<MaxRainDay> maxRainDayList;


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("-------");
        sb.append("\n");
        sb.append("开始时间:\t");
        sb.append(DateUtil.format(rainfallDate, DatePattern.NORM_DATE_PATTERN));
        sb.append("\n");
        sb.append("结束时间:\t");
        sb.append(DateUtil.format(endRainfallDate, DatePattern.NORM_DATE_PATTERN));
        sb.append("\n");
        sb.append("历时:\t");
        sb.append(rainfallTakeTime);
        sb.append("\n");
        sb.append("笼罩面积:\t");
        sb.append(totalRainfallArea);
        sb.append("\n");
        sb.append("总雨深:\t");
        sb.append(totalRainfallQ);
        sb.append("\n");
        sb.append("雨前降雨指数:\t");
        sb.append(beforeRainfallPoint);
        sb.append("\n");
        sb.append("相似值:\t");
        sb.append(resemblance);
        sb.append("\n");
        sb.append("日雨量:\n");
        if (dateRainfallQ != null) {
            for (int i = 0; i < dateRainfallQ.size(); i++) {
                sb.append("第").append(i + 1).append("日:\t");
                sb.append(dateRainfallQ.get(i));
                sb.append("\n");
            }
        }
        return sb.toString();
    }
}
